What is Stack in programing language. Explain it with normal language.
What is Stack in programing language. Explain it with normal language.
- What are the stack and heap?
- Where are they located physically in a computer's memory?
- To what extent are they controlled by the OS or language run-time?
- What is their scope?
- What determines their sizes?
- What makes one faster?
Hi, my self Ravi Vishwakarma. I have completed my studies at SPICBB Varanasi. now I completed MCA with 76% form Veer Bahadur Singh Purvanchal University Jaunpur.
SWE @ MindStick | Software Engineer | Web Developer | .Net Developer | Web Developer | Backend Engineer | .NET Core Developer
Amrita Bhattacharjee
08-Feb-2023A stack refers to a specific structure in data which is used in computer programming for storing specific elements in a particular order with the allowance of access as well as manipulation for the elements.
For stack,the specific elements are added to the top which is called as push technique and can get removed as well which is known as pop technique from the top. The whole process is known as last in, first out as here the last element is added refers to the first one to be removed.
As an example,stack of plates on a table whereas If we want to add a new plate to the top of the stack, we can simply place it on top of the other plates on the table and if we want to remove any plate then we can take it from the top of the stack. This is the actual meaning which is also applicable for a stack in programming.
Stacks can be used in programming for tracking function calls(recusion) and for implementing undo or redo of specific functionality as well.